//
//  DDbaseNetWork+HomePage.m
//  hnGovernment
//
//  Created by 安仔 on 17/3/7.
//  Copyright © 2017年 安仔. All rights reserved.
//

#import "DDbaseNetWork+HomePage.h"

@implementation DDbaseNetWork (HomePage)

- (NSNumber *)exhibitionId:(NSString *)exhibitionId cityId:(NSString *)cityId controller:(NSObject *)controller success:(successBlock)success failure:(failureBlock)failure {
    NSDictionary *params = @{
                             @"cityId":cityId,
                             @"exhibitionId":exhibitionId
                             };
    DDnetWrokEngine *engine = [DDnetWrokEngine engineWithControl:controller BaseUrl:G_HTTP_IP requestUrl:@"/app_api/selectService" requestType:DDrequestTypePOST requestParams:params success:success failure:failure];
    engine.cacheType = DDcacheTypeNetCache;
    engine.requestSerializer = DDRequestSerializerHTTP;
    return [self callRequestWithWorkEngnine:engine];
}


- (NSNumber *)exhibitionCategoryId:(NSString *)exhibitionCategoryId cityId:(NSString *)cityId controller:(NSObject *)controller success:(successBlock)success failure:(failureBlock)failure {
    NSDictionary *params = @{
                             @"cityId":cityId,
                             @"exhibitionCategoryId":exhibitionCategoryId
                             };
    DDnetWrokEngine *engine = [DDnetWrokEngine engineWithControl:controller BaseUrl:G_HTTP_IP requestUrl:@"/app_api/selectServiceByExhibitionCategoryId" requestType:DDrequestTypeGET requestParams:params success:success failure:failure];
    engine.cacheType = DDcacheTypeNetCache;
    engine.requestSerializer = DDRequestSerializerHTTP;
    return [self callRequestWithWorkEngnine:engine];
}


- (NSNumber *)selectInfoByConditionName:(NSString *)name cityId:(NSString *)cityId controller:(NSObject *)controller success:(successBlock)success failure:(failureBlock)failure {
    NSDictionary *params = @{
                             @"cityId":cityId,
                             @"name":name
                             };
    DDnetWrokEngine *engine = [DDnetWrokEngine engineWithControl:controller BaseUrl:G_HTTP_IP requestUrl:@"/app_api/selectInfoByCondition" requestType:DDrequestTypePOST requestParams:params success:success failure:failure];
    engine.cacheType = DDcacheTypeNetCache;
    engine.requestSerializer = DDRequestSerializerHTTP;
    return [self callRequestWithWorkEngnine:engine];
}

- (NSNumber *)bannerContentWithCityCode:(NSString *)cityCode controller:(NSObject *)controller success:(successBlock)success failure:(failureBlock)failure {
    NSDictionary *params = @{
                             @"cityCode":cityCode,
                             };
    DDnetWrokEngine *engine = [DDnetWrokEngine engineWithControl:controller BaseUrl:@"http://120.26.168.214:8003" requestUrl:@"/bannerContent/searchBannerContent" requestType:DDrequestTypePOST requestParams:params success:success failure:failure];
    engine.cacheType = DDcacheTypeNetCache;
    engine.requestSerializer = DDRequestSerializerHTTP;
    return [self callRequestWithWorkEngnine:engine];
}


- (NSNumber *)cityNewsWithCategoryId:(NSString *)categoryId Controller:(NSObject *)controller success:(successBlock)success failure:(failureBlock)failure {
    NSDictionary *params = @{
                             @"categoryId":categoryId ,
                             };

    DDnetWrokEngine *engine = [DDnetWrokEngine engineWithControl:controller BaseUrl:@"http://120.26.168.214:8003" requestUrl:@"/app_api/home/newsList" requestType:DDrequestTypePOST requestParams:params success:success failure:failure];
     //engine.cacheType = DDcacheTypeNetCache;
    engine.requestSerializer = DDRequestSerializerHTTP;
    return [self callRequestWithWorkEngnine:engine];
}


- (NSNumber *)hotCityNewsWithController:(NSObject *)controller success:(successBlock)success failure:(failureBlock)failure {
    DDnetWrokEngine *engine = [DDnetWrokEngine engineWithControl:controller BaseUrl:@"http://120.26.168.214:8003" requestUrl:@"/app_api/home/HotNewsList" requestType:DDrequestTypePOST requestParams:nil success:success failure:failure];
    //engine.cacheType = DDcacheTypeNetCache;
    engine.requestSerializer = DDRequestSerializerHTTP;
    return [self callRequestWithWorkEngnine:engine];

}


- (NSNumber *)categoryCityNewsWithController:(NSObject *)controller success:(successBlock)success failure:(failureBlock)failure {
    DDnetWrokEngine *engine = [DDnetWrokEngine engineWithControl:controller BaseUrl:@"http://120.26.168.214:8003" requestUrl:@"/app_api/home/getNewsCategory" requestType:DDrequestTypePOST requestParams:nil success:success failure:failure];
    //engine.cacheType = DDcacheTypeNetCache;
    engine.requestSerializer = DDRequestSerializerHTTP;
    return [self callRequestWithWorkEngnine:engine];
    
}


@end
